﻿@{
    ViewBag.Title = "ActivoAsignado";
}
@section CssImport{<link href="@Url.Content("~/Scripts/validationEngine/validationEngine.jquery.css")" rel="stylesheet" type="text/css" />}
@section JavascriptImport{
<script type="text/javascript" src="@Url.Content("~/Scripts/validationEngine/jquery.validationEngine.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/validationEngine/jquery.validationEngine-en.js")"></script>}

<div class="filtering">
    <form action="ActivoAsignado" method="post" target="_blank">
        <label>Introduzca texto para filtrar: <input type="text" name="filtro" title="Buscar o Filtrar, ingresando los caracteres que contenga el Nombre del Empleado"/></label>
        <button type="submit" id="LoadRecordsButton" class="button medium orange" ><img src="~/Content/images/lupa_naranja.jpg" width="15" height="15"/> Previsualizar</button>
        <img src="~/Content/images/pdf-icon.png" width="32" height="32" style="Position:Absolute; left:82%"/>
        &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
        &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
        &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
        &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
        &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
        &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
        &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
        <input type="submit" class="button medium blue" value="Ver Reporte"/>
    </form>
</div>
<div id="MyTableContainer"></div>
<script type="text/javascript">
    $(document).ready(function () {
        $('#MyTableContainer').jtable({
            title: 'Activos Asignados',
            paging: true,
            pageSize: 10,
            sorting: true,
            defaultSorting: 'Ciudad ASC',
            actions: {
                listAction: '@Url.Action("JSONPreviewActivoAsignado")'
            },
            fields:
         {
             NombreCompleto: {
                 title: 'NombreCompleto',
                 list: true,
                 sorting: false
             }
             ,
             FechaEntrega: {
                 title: 'FechaEntrega',
                 type: 'date',
                 displayFormat: 'dd-mm-yy',
                 list: true,
                 sorting: false
             }
             ,
             NombreEquipo: {
                 title: 'NombreEquipo',
                 list: true,
                 sorting: false
             }
             ,
             CodigoActivo: {
                 title: 'CodigoActivo',
                 list: true,
                 sorting: false
             }
         },
            formCreated: function (event, data) { data.form.validationEngine(); },
            formSubmitting: function (event, data) { return data.form.validationEngine('validate'); },
            formClosed: function (event, data) { data.form.validationEngine('hide'); data.form.validationEngine('detach'); }
        });
        $('#LoadRecordsButton').click(function (e) { e.preventDefault(); $('#MyTableContainer').jtable('load', { filter: $('#filtro').val() }); });
        $('#LoadRecordsButton').click();
    });
</script>